package Text11;

import java.util.*;

public class Main {
    static int N = 110;
    static int[] h = new int[N];
    static int[] f = new int[N];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int T = in.nextInt();
        while (T-- > 0) {
            int n = in.nextInt();
            for (int i = 1; i <= n; i++) {
                h[i] = in.nextInt();
            }
            int res = 0;
            for (int i = 1; i <= n; i++) {
                f[i] = 1;
                for (int j = 1; j < i; j++) {
                    if (h[i] > h[j]) {
                        f[i] = Math.max(f[i], f[j] + 1);
                    }
                }
                res = Math.max(res, f[i]);
            }
            for (int i = n; i >= 1; i--) {
                f[i] = 1;
                for (int j = n; j > i; j--) {
                    if (h[i] > h[j]) {
                        f[i] = Math.max(f[i], f[j] + 1);
                    }
                }
                res = Math.max(res, f[i]);
            }
            System.out.println(res);
        }
    }
}
